package com.corpgovernment.common.enums;


/**
 * @Description:
 * @Author lwli
 * @Date 2020/6/29
 */
public enum FlightCancelTypeEnum {
	/**
	 * 用户主动取消
	 */
	A("A", "用户主动取消"),
	/**
	 * 服务商取消
	 */
	B("B", "服务商取消"),
	/**
	 * 超时取消
	 */
	C("C", "超时取消"),
	/**
	 * 审批拒绝取消
	 */
	R("R", "审批拒绝取消"),
	;

	FlightCancelTypeEnum(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	private String code;

	public String getCode() {
		return code;
	}

	private String desc;

	public String getDesc() {
		return desc;
	}

	/**
     * 根据code查找枚举
     *
     * @param code
     * @return
     */
    public static FlightCancelTypeEnum getByCode(String code) {
        FlightCancelTypeEnum[] values = FlightCancelTypeEnum.values();
        for (FlightCancelTypeEnum enums : values) {
            if (enums.toString().equalsIgnoreCase(code)) {
                return enums;
            }
        }
        return C;
    }
}
